<?php
defined('IN_APPS') or die('Go away sucker!');

class CommentModel extends Model {
	
	protected $name = 'comments';
	
	
	public function getBlogComment($id)
	{
		$sql = 'SELECT * FROM ' . $this->tableName . ' WHERE c_blog_id = ' . $id;
		$query = mysql_query( $sql );
		
		// empty array
		$result = array();
		
		if ($query) {
			while( $row = mysql_fetch_array( $query ) ) {
				$result[] = $row;
			}
			return $result;
		}
		else {
			die('Error: ' . mysql_error());
		}
	}
	
}
